package com.errorfinding.tabbitmqDemo.consumer;

import com.errorfinding.tabbitmqDemo.config.ConfirmConfig;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * 消费者
 * 接收消息
 */
@Component
public class Consumer {

    @RabbitListener(queues = ConfirmConfig.confirm_queue_name)
    public void receiveConfirmMessage(Message message){
        System.out.println("接收队列confirm_queue消息："+new String(message.getBody()));
    }

}
